<template>
  <view class="wrapper">
    <view class="logo">
      <u-image class="img" radius="36rpx" :src="'https://res.jiyaqi.com/pet/miniapp/ewmLogo.png'" width="144rpx" height="144rpx"
        mode="aspectFill"></u-image>
    </view>
    <view class="about">
      <view class="cell">
        <view class="cell-item" hover-class="active">
          <view class="left">
            版本号
          </view>
          <view class="right">
            <text class="version">{{version}}</text>
            <!-- <text class="update">更新</text> -->
            <!-- <u-icon name="arrow-right" color="#B3B3B3" size="26rpx"></u-icon> -->
          </view>
        </view>
        <!-- http://ta.jiyaqi.com/policy/app_privacy.html -->
        <view class="cell-item" @click="routerJump('http://ta.jiyaqi.com/policy/app_user_policy.html','用户协议')"
          hover-class="active">
          <view class="left">
            用户协议
          </view>
          <view class="right">
            <u-icon name="arrow-right" color="#B3B3B3" size="26rpx"></u-icon>
          </view>
        </view>
        <!-- http://ta.jiyaqi.com/policy/app_user_policy.html -->
        <view class="cell-item" @click="routerJump('http://ta.jiyaqi.com/policy/app_privacy.html','隐私政策')"
          hover-class="active">
          <view class="left">
            隐私政策
          </view>
          <view class="right">
            <u-icon name="arrow-right" color="#B3B3B3" size="26rpx"></u-icon>
          </view>
        </view>
      </view>
    </view>
    <view class="bottomZX" @click="toPage('set/logout')">
      <text>注销账号</text>
    </view>
  </view>
</template>

<script>
import pageMixin from '@/mixins/pageMixin'
export default {
  mixins: [pageMixin],
  data () {
    return {
      version: null,
    }
  },
  methods: {
    routerJump (url, type) {
      console.log(url)
      this.toPage(`public/webview?url=${url}&type=${type}`, false)
    }
  },
  onLoad (options) {
    let res = uni.getSystemInfoSync()
    this.version = res.appVersion
  }
}
</script>

<style lang="scss" >
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 400;
  .img {
    margin: 80rpx auto;
  }
  .name {
    margin: 22rpx 0 0;
    font-size: 32rpx;
    color: #121212;
    line-height: 45rpx;
  }
  .version {
    margin-bottom: 72rpx;
    font-size: 26rpx;
    color: #999999;
    line-height: 37rpx;
  }
}
.about {
  background-color: #ffffff;
  .cell {
    margin-top: 20rpx;
    background-color: #ffffff;
    &-item {
      position: relative;
      align-items: center;
      justify-content: space-between;
      width: 100vw;
      padding: 0 32rpx;
      height: 112rpx;
      display: flex;
      &.active {
        background-color: #f8f8f8;
      }
      .left {
        font-size: 32rpx;
        font-weight: 400;
        color: #121212;
      }
      .right {
        display: flex;
        align-items: center;
        font-size: 32rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #999999;
        .update {
          margin: 0 16rpx;
          color: #FF5900;
        }
        .phone,
        .avatar {
          margin-right: 20rpx;
        }
      }
    }
  }
}
.bottomZX {
  width: 100%;
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 112rpx;
  background-color: #ffffff;
  text {
    font-size: 32rpx;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 32rpx;
  }
}
</style>
